#ifndef CUSPROXYMODEL_H
#define CUSPROXYMODEL_H

#include <QSortFilterProxyModel>
#include <QObject>

class CusProxyModel : public QSortFilterProxyModel
{
public:
    Q_PROPERTY(QAbstractItemModel* cSourceModel READ cSourceModel WRITE setCSourceModel)
    explicit CusProxyModel(QObject *parent = nullptr);

    //filter
    Q_INVOKABLE void filterByState(int state);
    Q_INVOKABLE void filterByGroup(const QString& groupName);

    //q_property
    QAbstractItemModel *cSourceModel() const;
    void setCSourceModel(QAbstractItemModel *newCSourceModel);

    //override
    void setSourceModel(QAbstractItemModel *sourceModel) override;

signals:

private:
    QAbstractItemModel *m_cSourceModel;
};

#endif // CUSPROXYMODEL_H
